from transformers import HfArgumentParser
from dataclasses import dataclass, field
import argparse

# 定义数据类
@dataclass
class ModelArguments:
    model_name_or_path: str = field(metadata={"help": "Path to pretrained model or model identifier"})
  
@dataclass
class DataTrainingArguments:
    train_file: str = field(metadata={"help": "Path to the training file"})
    validation_file: str = field(metadata={"help": "Path to the validation file"})

# 创建参数解析器
parser = HfArgumentParser((ModelArguments, DataTrainingArguments))

# 解析命令行参数
model_args, data_args = parser.parse_args_into_dataclasses()
